thin.imports('/public/configure/conf.agency.js');
thin.imports('/public/plug/LoadEffect/LoadEffect.js');

thin.use(function() {
	// 頁面加載完畢
	thin.effect();

	if(thin.data['data-id'] > 0) {

		layer.load(0, {
			shade: [0.08, '#000']
		});

		// 加載合作機構詳情
		__getdata_agencyget['id'] = thin.data['data-id'];
		factory.request('_agency_get');
	}

});

var __getdata_agencyget = {};

// 合作機構詳情回調
function __complete_agencyget(res) {
	layer.closeAll('loading');
	if(res.status == 200) {
		binddata(res.data);
	} else {
		// nothing
	}
}

// 綁定數據
function binddata(data) {
	document.title = '价值链_' + data.title;
	$('#bind-pd-logo').attr('src', data.logo);
	$('#bind-pd-title').text(data.title);
	var val = data.introduction;
	val = val.replace(/&lt;/gi, '<');
	testEditormdView = editormd.markdownToHTML("bind-pd-introduction", {
		markdown: val,
		htmlDecode: "style,script,iframe", // you can filter tags decode
		tocm: true, // Using [TOCM]
		emoji: true,
		taskList: true,
		tex: true, // 默认不解析
		flowChart: true, // 默认不解析
		sequenceDiagram: true, // 默认不解析
	});
}